
import java.util.Scanner;
public class Lab02 {
	
	public static void func1()
	{
		Scanner sc= new Scanner(System.in);
		int a = sc.nextInt();
		int b =(int)(Math.random()*3);
		if((a==0&&b==2)||(a==1&&b==0)||(a==2&&b==1))
			System.out.println("赢");
		if(a==b)
			System.out.println("平");
		if((a==2&&b==0)||(a==0&&b==1)||(a==1&&b==2))
			System.out.println("输");
		
		
	}
	public static void func2()
	{	System.out.print("Enter the length from the center to a vertex: ");
		Scanner sc= new Scanner(System.in);
		double r=sc.nextDouble();
		double s =2*r*Math.sin(Math.PI/5);
		System.out.println("");
		double area=5*s*s/(4*Math.tan(Math.PI/5));
		System.out.println("The area of the pentagon is "+area);
		
	}
	public static void func3()
	{
		Scanner sc= new Scanner(System.in);
		String s=sc.next();
		char c=s.charAt(s.length()-1);
		System.out.println(s.length());
		System.out.println(c);
	}
	public static void func4()
	{
		Scanner sc= new Scanner(System.in);
		System.out.print("Entert string s1:");
		String s1=sc.next();
		System.out.print("Enter string s2:");
		String s2=sc.next();
		if(s1.indexOf(s2)!=-1)
			System.out.println(s2+" is a substring of "+s1);
		else
			System.out.println(s2+" is not a substring of "+s1);
		
		
	}
	public static void func5()
	{
		int i,cnt=0;
		for(i=100;i<=1000;i++)
		{
			if((i%5==0)||(i%6==0))
			{
				System.out.print(i+" ");
				cnt++;
			}
			if(cnt%10==0)
				System.out.println();
		}
		
	}
	public static void func6()
	{
		Scanner sc= new Scanner(System.in);
		int num=sc.nextInt();
		int i;
		while(num!=0)
		{
			for(i=2;i<=num;i++)
			{
				if(num%i==0)
				{
					System.out.print(i+" ");
					num=num/i;
					break;
				}
					
			}
		}
	}
	public static int sumDigits(long n)
	{
		long num=n;
		int  sum=0;
		while(num!=0)
		{
			sum+=num%10;
			num=num/10;
		}
		return sum;	
		
	}
	public static int reverse(int number) {
		int reverseNumber = 0;
		do {
			reverseNumber = reverseNumber * 10 + number % 10;
			number /= 10;
		}while(number > 0);
		
		return reverseNumber;
	}
	public static boolean isPalindrome(int number) {
		return reverse(number) == number;
	}	
	public static void func9()
	{
		
		int arr[]=new int[10],i;
		for(i=0;i<=9;i++)
			arr[i]=0;
		for(i=0;i<=9;i++)
		{
			int b =(int)(Math.random()*9);
			if(b==0)arr[0]++;
			if(b==1)arr[1]++;
			if(b==2)arr[2]++;
			if(b==3)arr[3]++;
			if(b==4)arr[4]++;
			if(b==5)arr[5]++;
			if(b==6)arr[6]++;
			if(b==7)arr[7]++;
			if(b==8)arr[8]++;
			if(b==9)arr[9]++;
				
		}
		for(i=0;i<=9;i++) {
			System.out.print(arr[i]+" ");
		}
	}
	public static int average(int[] array)
	{
		int i=0;
		int average=0;
		while(i<=array.length )
		{
			average+=array[i];
			i++;
		}
		average/=array.length;
		return average;
	}
	public static double average(double[] array)
	{
		int i=0;
		double average=0;

		while(i<array.length )
		{
			average+=array[i];
			i++;
		}
			
		average/=array.length;
		return average;
	}
	public static void main(String[] args) {
		func1();
		func2();
		func3();
		func4();
		func5();
		func6();
		System.out.println(sumDigits(234));
		System.out.println(reverse(234));
		System.out.println(isPalindrome(232));
		func9();

		double [] arr=new double [10];
		Scanner sc= new Scanner(System.in);
		int i=0;
		for(i=0;i<=9;i++)
			arr[i]=sc.nextDouble();
		System.out.println(average(arr));

	}

}